#! /usr/bin/env sh
set -e

PRE_START_PATH=/app/prestart.sh
echo "Checking for script in $PRE_START_PATH"
if [ -f ${PRE_START_PATH} ]; then
    echo "Running $PRE_START_PATH"
    . "$PRE_START_PATH"
else
    echo "There is no $PRE_START_PATH"
fi

# Start Gunicorn
exec gunicorn -k uvicorn.workers.UvicornWorker -c "/app/gunicorn_config.py" "app:app"
#bash